package com.per.yyyFrame.enums;

import jodd.util.ObjectUtil;
import org.apache.commons.lang.ObjectUtils;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public enum SqlType {
    INSERT("INSERT"),
    DELETE("DELETE"),
    UPDATE("UPDATE"),
    SELECT("SELECT");

    private String type;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    SqlType(String type) {
        this.type = type;
    }

    public static SqlType getName(String name){
        if(name==null){
            return null;
        }
        for(SqlType sqlType:SqlType.values()){
            if(sqlType.name().equals(name)){
                return sqlType;
            }else if(ObjectUtils.equals(name.toUpperCase(),sqlType.name())){
                return sqlType;
            }
        }
        return null;
    }


    //public abstract void builderSql(String sql,List param);
}
